<!DOCTYPE html>
<html>
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8" /><!-- /Added by HTTrack -->
<head>
    <meta charset="utf-8">
    
    <title>注册</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width">
    
    <link rel="shortcut icon" href="__PUBLIC__/Home/favicon.ico">

    <link rel="stylesheet" href="__PUBLIC__/Home/css/grid.css">
    <link rel="stylesheet" href="__PUBLIC__/Home/css/style.css">
    <link rel="stylesheet" href="__PUBLIC__/Home/css/normalize.css">
    <link rel="stylesheet" href="__PUBLIC__/Home/css/login.css">

    <script src="__PUBLIC__/Home/js/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="__PUBLIC__/Home/js/jquery-1.8.3.min.js"><\/script>')</script>
    <script src="__PUBLIC__/Home/js/html5.js"></script>
    <script src="__PUBLIC__/Home/js/main.js"></script>
    <script src="__PUBLIC__/Home/js/radio.js"></script>
    <script src="__PUBLIC__/Home/js/checkbox.js"></script>
    <script src="__PUBLIC__/Home/js/selectBox.js"></script>
    <script src="__PUBLIC__/Home/js/jquery.carouFredSel-5.2.2-packed.js"></script>
    <script src="__PUBLIC__/Home/js/jquery.jqzoom-core.js"></script>
    <script src="__PUBLIC__/Home/js/jquery.transit.js"></script>
    <script src="__PUBLIC__/Home/js/jquery.easing.1.2.js"></script>
    <script src="__PUBLIC__/Home/js/jquery.anythingslider.js"></script>
    <script src="__PUBLIC__/Home/js/jquery.anythingslider.fx.js"></script>
</head>
<body>
    <include file="config/header" />
    
    <section id="main" class="page-login">
        <div class="container_12">
            <div id="content" class="grid_12">
                <header>
                    <h1 class="page_title">登录或者创建一个帐户</h1>
                </header>
                    
                <article>
                    <div class="grid_6 new_customers">
			<h2>新客户</h2>
			<p>通过在我们的商店创建帐户，您将能够更快地浏览结帐流程，存储多个送货地址，查看和跟踪您的帐户中的订单等。</p>
			<div class="clear"></div>
			<button class="account">申请用户</button>
                    </div><!-- .grid_6 -->
		
                    <div class="grid_6 registed_form">
			<form class="registed" action="" method="post" onsubmit="return tijiao()">
			    <h2>注册客户</h2>
			    <p>如果您有我们的帐户，请登录。</p>
                <div class="user_account">
                <sup>*</sup><strong>用户账号：</strong><span></span><br>
                <input type="user_account" name="arr[user_account]" class="" value="">
                </div><!-- .email -->
			    <div class="user_account">
				<sup>*</sup><strong>电子邮件：</strong><span></span><br>
				<input type="email" name="arr[user_email]" class="" value="">
			    </div><!-- .email -->
			    <div class="password">
				<sup>*</sup><strong>密码：</strong><span></span><br>
				<input type="password" name="arr[user_pwd]" class="" value="">
			    </div><!-- .password -->
                <div class="password">
                <sup>*</sup><strong>确定密码：</strong><span></span><br>
                <input type="password" name="arr[user_pwds]" class="" value="">
                </div><!-- .passwords -->
                <div class="phone">
                <sup>*</sup><strong>电话：</strong><span></span><br>
                <input type="phone" name="arr[user_phone]" class="" value="">
                </div>
                <div class="code">
                <sup>*</sup><strong>验证码：</strong><span></span><br>
                <input type="code" name="arr[code]" class="" value="">
                <input type="button" name="" class="" value="点击发送验证码" onclick=sendSMS() id="code">
                </div>
                <div class="remember">
                <input class="niceCheck" type="checkbox" name="Remember_password">
                <span class="rem">记住密码</span>
                </div><!-- .remember -->
			    <div class="submit">										
				<input type="submit" value="登录">
                                <a class="forgot" href="#">忘记密码?</a>
				<sup>*</sup><span>必填字段</span>
			    </div><!-- .submit -->
			</form><!-- .registed -->
                    </div><!-- .grid_6 -->
		</article>
<script type="text/javascript">
    function tijiao(){
        var user_name = $("input[name='arr[user_account]']").val();         //用户名
        var user_email = $("input[name='arr[user_email]']").val();          //电子邮件
        var user_pwd = $("input[name='arr[user_pwd]']").val();              //用户密码
        var user_pwds = $("input[name='arr[user_pwds]']").val();            //用户密码s
        var user_phone = $("input[name='arr[user_phone]']").val();            //手机号码
        var code = $("input[name='arr[code]']").val();            //验证码
        console.log(user_pwd);
        console.log(user_pwds);
        console.log(user_pwd.length);
        if(user_name ==  false || user_email == false){
            alert("带“ * ”不能为空");
            return false;
        }
        if(user_pwd != user_pwds || user_pwd == false || user_pwds == false){
            alert("密码不一致，请确定！");
            return false;
        }
        if(user_pwd.length<6){
            alert("输入的密码必须大于或者等于6位");
            return false; 
        }
        if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(user_phone))){
            alert("手机格式不正确！");
            return false;
        }
        
    }

    var countdown=60; 
    var code;

    function settime() { 
        var user_phone = $("input[name='arr[user_phone]']").val();
        if(user_phone==''){
            alert("请输入手机号码");
            return;
        }
        if(!(/^1[3|4|5|8][0-9]\d{4,8}$/.test(user_phone))){
            alert("手机号码格式不对");
            return;
        }
        code = document.getElementById('code');
        console.log(code);
        if (countdown == 0) { 
            code.removeAttribute("disabled");
            code.value="免费获取验证码"; 
            countdown = 60; 
            return;
        } else { 
            code.setAttribute("disabled", true); 
            code.value="重新发送(" + countdown + ")"; 
            countdown--; 
        } 
        setTimeout(function() { 
            settime();
        },1000) 
    }

    function sendSMS() {  
        settime();
        var user_phone = $("input[name='arr[user_phone]']").val();
        $.ajax({    
            type:'post',        
            url:'<?php echo API_PATH;?>',    
            data: 'user_phone='+user_phone,
            async:false,  
            dataType:'json',  
            cache:false,  
            success:function(data){
                var_dump($_COOKIE['code']);
                alert(data.msg);
            },
       
        });    
    } 
</script>
                <div class="clear"></div>
            </div><!-- #content -->

            <div class="clear"></div>
        </div><!-- .container_12 -->
    </section><!-- #main -->
    <div class="clear"></div>
        
    <include file="config/footer" />
</body>
<meta http-equiv="content-type" content="text/html;charset=utf-8" />
</html>
